<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    import="java.sql.*"
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>權限管理</title>

</head>

<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/> <%//連結資料庫的bean %>

<table width="750" border="0" align="center">
  <tr>
    <td width="30" rowspan="4"><jsp:include page="../frameset/left.jsp" flush="true" ></jsp:include></td>
    <td colspan="2"><jsp:include page="../frameset/top.jsp" flush="true" ></jsp:include></td>
    <td width="40" rowspan="4"><jsp:include page="../frameset/right.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td rowspan="2"><jsp:include page="../frameset/mean.jsp" flush="true" ></jsp:include>

    </td>
    <td height="32"><jsp:include page="../frameset/level_mean.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td>
   
    <%--內頁--%>
   <%
      String sql="select * from SYS_SETTING WHERE S_NAME='delay_day_deadline'";
	  ResultSet rs=mydb.executeQuery(sql);
	  rs.next();
      String delay_day = rs.getString(3); //取出逾期天數底限
      
      sql="select * from SYS_SETTING WHERE S_NAME='delay_item_deadline'";
	  rs=mydb.executeQuery(sql);
	  rs.next();
      String delay_item = rs.getString(3); //取出逾期項目數量底限
      
      sql="select * from SYS_SETTING WHERE S_NAME='damage_freq'";
	  rs=mydb.executeQuery(sql);
	  rs.next();
      String dam_freq = rs.getString(3); //取出破壞場地設備次數底限
      
    %>
   <P>管理會員權限之規則:<br>
   (符合以下任一條件之會員則不得使用預借服務之功能)<br>
   1.逾期天數超過<%=delay_day%>天以上<br>
   2.逾期項目超過<%=delay_item%>項以上<br>
   3.破壞場地設備<%=dam_freq%>次以上
   </P> 
   <p>
     <%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
</p>
   
   
    <table width="580" border="0">
      <tr>
        <td width="465"><div align="right">修改權限規則</div></td>
        <td width="105"><div align="center"><a href="alterLevelrule.jsp" target="_self" class="style2"><img src="../image/modify.gif" width="52" height="19" border="0"></div></a></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </body>
</html>
